<template>
  <div>
    <h1>学生查找</h1>
    <input v-model="studentId" placeholder="请输入学号" />
    <button @click="searchStudent">查找</button>
    <div v-if="studentInfo">
      <p>姓名: {{ studentInfo.name }}</p>
      <p>学号: {{ studentInfo.id }}</p>
      <p>专业: {{ studentInfo.major }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      studentId: '',
      studentInfo: null
    }
  },
  methods: {
    searchStudent() {
      // 模拟查找逻辑
      this.studentInfo = {
        name: '张三',
        id: this.studentId,
        major: '计算机科学'
      }
    }
  }
}
</script>